home *** CD-ROM | disk | FTP | other *** search
- Tutorial for Crackme 13 ID:10 (tC...)
- by Sanhedrin
-
- Tools
- W32Dasm
- Softice
- HIEW
-
-
- --INTRODUCTION--
-
- This crackme has a menu button disabled. The rules also state that we are not allowed to patch
- the jump itself.
-
-
- --FINDING THE REFERENCE--
-
- I have to admit that it took me a while to figure out exactly where to start with this crackme.
- I searched through the code and found very little. Then I saw the EnableMenuItem. A quick look
- at the Win32 Programmer's Reference:
-
- EnableMenuItem - Specifies the menu item to be enabled, disabled, or grayed, as determined by the
- uEnable parameter. This parameter specifies an item in a menu bar or in a pop-up menu.
-
-
- This means that a call to EnableMenuItem diables (and greys) the button called 'Menue'. Therefore,
- we have to find where the call is made, and find a way of patching without changing the jump. So,
- let's disassemble the crackme, and see what calls there are to EnableMenuItem. After a quick search,
- you will come to 004329E4.
-
- |
- :004329E4 8B7E58 mov edi, dword ptr [esi+58]
- :004329E7 85FF test edi, edi
- :004329E9 7427 je 00432A12<---jump past EnableMenuItem if zero
- :004329EB F6462002 test [esi+20], 02
- :004329EF 7521 jne 00432A12
- :004329F1 33C0 xor eax, eax
- :004329F3 8AC3 mov al, bl
- :004329F5 8B0485D4374400 mov eax, dword ptr [4*eax+004437D4]
- :004329FC 83C800 or eax, 00000000
- :004329FF 50 push eax
- :00432A00 0FB74644 movzx eax, word ptr [esi+44]
- :00432A04 50 push eax
- :00432A05 8BC7 mov eax, edi
- :00432A07 E824F4FFFF call 00431E30
- :00432A0C 50 push eax
-
- * Reference To: user32.EnableMenuItem, Ord:0000h
- |
- :00432A0D E89A36FDFF Call 004060AC
-
- * Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
- |:004329E9(C), :004329EF(C)
- |
- :00432A12 33D2 xor edx, edx
- :00432A14 8BC6 mov eax, esi
- :00432A16 8B08 mov ecx, dword ptr [eax]
- :00432A18 FF5134 call [ecx+34]
-
-
- Notice that we have two oportunities to jump over the refernce. I am sure that there are many ways to
- patch this one, but the method I chose was to change the test edi,edi to something that would be zero,
- allowing the jump to take place. A quick look in softice that the register EBX is zero when this test
- takes place. Therefore, in order to crack this one, change:
-
- 004329E7 85FF test edi, edi
-
- to
-
- 85FB test ebx, edi
-
-
- and the Menue button will be enabled.
-
-
- --FINAL NOTES--
-
- It is a good idea to find the Win32 Programmer's Reference. It is an 11MB file and well worth the download
- time.
-
-
-
- Greets to tC...
-
- Thanks to all of those coders that make these crackmes, to Pepper for sending me on the
- right path so long ago and of course to Eternal Bliss.
-
-
- Sanhedrin
- stachi@geocities.com